package org.hp.service.dictionary;

import com.github.pagehelper.PageHelper;
import org.hp.bean.Hosptial;
import org.hp.dao.dictionary.HosptalDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class HosptalServiceImpl implements HosptalService {
    @Resource
    HosptalDao hosptalDao;

    @Override
    public List<Hosptial> queryHosp(Integer limit, Integer page, String hname) {
        PageHelper.startPage(page,limit);
        return hosptalDao.queryHosp(hname);
    }

    @Override
    public int addHosp(Hosptial h) {
        return hosptalDao.addHosp(h);
    }

    @Override
    public Hosptial queryOneHosp(Integer hid) {
        return hosptalDao.queryOneHosp(hid);
    }

    @Override
    public int updateHosp(Hosptial h) {
        return hosptalDao.updateHosp(h);
    }

    @Override
    public List<Hosptial> queryDelHosp(Integer limit, Integer page, String hname) {
        PageHelper.startPage(page,limit);
        return hosptalDao.queryDelHosp(hname);
    }

    @Override
    public int delHosp(Integer hid) {
        return hosptalDao.delHosp(hid);
    }

    @Override
    public int returnHosp(Integer hid) {
        return hosptalDao.returnHosp(hid);
    }
}
